﻿

using LiveCharts;
using LiveCharts.Wpf;
using System;

namespace Business.ViewModels
{
    public class MainPageViewModel
    {
        public MainPageViewModel()
        {
            SeriesCollection1 = new SeriesCollection
            {
                new ColumnSeries
                {
                    Title = "记录总数",
                    Values = new ChartValues<int> { 80, 50,30,40,23,89 }
                }
            };

            //adding series will update and animate the chart automatically
            SeriesCollection1.Add(new ColumnSeries
            {
                Title = "已完成数",
                Values = new ChartValues<int> { 11, 56, 30, 34, 33, 40 }
            });

            SeriesCollection = new SeriesCollection
            {
                new ColumnSeries
                {
                    Title = "记录总数",
                    Values = new ChartValues<int> { 80, 50,30,40,23,89 }
                }
            };

            //adding series will update and animate the chart automatically
            SeriesCollection.Add(new ColumnSeries
            {
                Title = "已完成数",
                Values = new ChartValues<int> { 11, 56, 30, 34, 33 }
            });

            //also adding values updates and animates the chart automatically
            SeriesCollection[1].Values.Add(20);

            Labels = new[] { "周一", "周二", "周三", "周四", "周五", "周六" };
            Formatter = value => value.ToString();
           //DataContext = this;
        }
        public SeriesCollection SeriesCollection { get; set; }
        public SeriesCollection SeriesCollection1 { get; set; }
        public string[] Labels { get; set; }
        public Func<double, string> Formatter { get; set; }
    }
}